package com.zlzlib.nettytest;

import android.util.Log;

import com.zlzlib.libnetty.base.BaseChannelInitializer;
import com.zlzlib.libnetty.base.BaseClient;
import com.zlzlib.libnetty.listener.NettyEvenListener;
import com.zlzlib.libnetty.listener.WebSocketListener;
import com.zlzlib.libnetty.ws.WebChannelInitializer;

import java.net.URI;

import io.netty.channel.Channel;
import io.netty.handler.codec.http.HttpHeaders;

/**
 * 测试的配置 都是默认配置
 *
 * @DateTime: 2022/11/2 17:32
 * @Author zlz
 * @Version 1.0
 */
public class DemoNettyEven implements NettyEvenListener<Object> {

    @Override
    public void dispatchMsg(Object msg) {
        Log.i(getClass().getName(), "dispatchMsg: " + msg);
    }

    @Override
    public void msgSendState(Object msg, boolean isSuccess) {
        Log.i(getClass().getName(), "msgSendState: " + msg + " is: " + isSuccess);
    }

    @Override
    public boolean isNetworkAvailable() {
        //当前网络是否可用 这里测试写死
        return true;
    }

    @Override
    public int getReconnectInterval() {
        return 0;
    }

    @Override
    public int getConnectTimeout() {
        return 0;
    }

    @Override
    public int getResendCount() {
        return 0;
    }

    @Override
    public int getResendInterval() {
        return 0;
    }

    @Override
    public int getForegroundHeartbeatInterval() {
        return 0;
    }

    @Override
    public int getBackgroundHeartbeatInterval() {
        return 0;
    }

    @Override
    public <B extends Channel> BaseChannelInitializer<B> getTcpChannel(BaseClient<Object> client) {
        return null;
    }

    @Override
    public WebChannelInitializer getWebChannel(WebSocketListener socketListener, URI url, HttpHeaders headers) {
        return null;
    }
}
